// mock/user.js
var SUCCESS_MESSAGE = "\u63A5\u53E3\u8FDE\u63A5\u6B63\u5E38";
var ERROR_MESSAGE = "\u63A5\u53E3\u5F02\u5E38";
var userList = [
  {
    name: "admin",
    password: "admin",
    dept: 1,
    depaName: "\u7BA1\u7406\u5458",
    sex: "male",
    id: 1,
    token: "123456"
  },
  {
    name: "\u5F20\u4E09",
    password: "zs",
    dept: 2,
    depaName: "\u6D4B\u8BD5",
    sex: "male",
    id: 2,
    token: "123456"
  },
  {
    name: "\u674E\u56DB",
    password: "ls",
    dept: 2,
    depaName: "\u6D4B\u8BD5",
    sex: "male",
    id: 3,
    token: "123456"
  }
];
var user_default = [
  {
    url: "/api/login",
    method: "post",
    response: ({ body }) => {
      const { userName, password } = body;
      const userInfo = userList.find((item) => item.name === userName && item.password === password);
      if (!userInfo) {
        return { code: 201, data: {}, message: "\u7528\u6237\u540D\u6216\u5BC6\u7801\u9519\u8BEF" };
      }
      return { code: 200, data: userInfo, message: SUCCESS_MESSAGE };
    }
  },
  {
    url: "/api/getList",
    method: "post",
    response: (req) => {
      return {
        code: 200,
        data: userList
      };
    }
  },
  {
    url: "/api/getUserInfo",
    method: "get",
    response: ({ query }) => {
      const { id } = query.id;
      if (id) {
        const userInfo = userList.find((item) => item.id === id);
        if (userInfo) {
          return { code: 200, data: userInfo, message: SUCCESS_MESSAGE };
        }
        return { code: 201, data: {}, message: ERROR_MESSAGE };
      }
      return { code: 201, data: {}, message: ERROR_MESSAGE };
    }
  }
];
export {
  user_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsibW9jay91c2VyLmpzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJjb25zdCBfX2luamVjdGVkX2ZpbGVuYW1lX18gPSBcIkQ6XFxcXFx1NTI0RFx1N0FFRlxcXFx2dWUzX2RlbW9cXFxcbXktdnVlMy12aXRlXFxcXG1vY2tcXFxcdXNlci5qc1wiO2NvbnN0IF9faW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2U6IChyZXEpID0+IHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIGNvZGU6IDIwMCxcclxuICAgICAgICAgICAgICAgIGRhdGE6IHVzZXJMaXN0XHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgfSxcclxuICAgIH0sXHJcbiAgICB7XHJcbiAgICAgICAgdXJsOiAnL2FwaS9nZXRVc2VySW5mbycsXHJcbiAgICAgICAgbWV0aG9kOiAnZ2V0JyxcclxuICAgICAgICByZXNwb25zZTogKHsgcXVlcnkgfSkgPT4ge1xyXG5cclxuICAgICAgICAgICAgY29uc3QgeyBpZCB9ID0gcXVlcnkuaWQ7XHJcbiAgICAgICAgICAgIGlmIChpZCkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgdXNlckluZm8gPSB1c2VyTGlzdC5maW5kKGl0ZW0gPT4gaXRlbS5pZCA9PT0gaWQpO1xyXG4gICAgICAgICAgICAgICAgaWYgKHVzZXJJbmZvKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgY29kZTogMjAwLCBkYXRhOiB1c2VySW5mbywgbWVzc2FnZTogU1VDQ0VTU19NRVNTQUdFIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJldHVybiB7IGNvZGU6IDIwMSwgZGF0YToge30sIG1lc3NhZ2U6IEVSUk9SX01FU1NBR0UgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiB7IGNvZGU6IDIwMSwgZGF0YToge30sIG1lc3NhZ2U6IEVSUk9SX01FU1NBR0UgfVxyXG5cclxuICAgICAgICB9LFxyXG4gICAgfSxcclxuXTtcclxuIl0sCiAgIm1hcHBpbmdzIjogIjtBQUNBLElBQU0sa0JBQWtCO0FBQ3hCLElBQU0sZ0JBQWdCO0FBQ3RCLElBQU0sV0FBVztBQUFBLEVBQ2I7QUFBQSxJQUNJLE1BQU07QUFBQSxJQUNOLFVBQVU7QUFBQ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